package com.diy.sigmund.diyorder;

import java.time.ZoneId;
import java.util.TimeZone;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

//添加熔断降级注解
//@EnableCircuitBreaker
@EnableDiscoveryClient
@EnableFeignClients
@MapperScan("com.diy.sigmund.diyorder.mapper")
// 排除SecurityAutoConfiguration和ManagementWebSecurityAutoConfiguration可以禁用spring-security鉴权
@SpringBootApplication(scanBasePackages = "com.diy.sigmund", exclude = {SecurityAutoConfiguration.class,
        ManagementWebSecurityAutoConfiguration.class})
public class DiyOrderApplication {

    public static void main(String[] args) {
        // 此时设置的timezone时区，是在系统的缓存中，作用域是此时运行的整个程序，
        // 对其他在设置之后的线程都有效，但是此时设置的时区，并不会影响java vm中的user.timezone属性（也就是系统属性）
        // CTT - Asia/Shanghai
        TimeZone.setDefault(TimeZone.getTimeZone(ZoneId.of("CTT", ZoneId.SHORT_IDS)));
        SpringApplication.run(DiyOrderApplication.class, args);
    }
}
